﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace BaoJian.Control
{
    public partial class ColImg : System.Web.UI.UserControl
    {
        public string URL;
        public string Alt;
        public string Region;
        public string Width;
        public string Height;
        public string CSS = null;
        public string Src;
        protected void Page_Load(object sender, EventArgs e)
        {
           //TODO: 添加判断Src是否为空。
            if ((!string.IsNullOrEmpty(Src)) && Src.ToLower().Contains(".swf"))
            {
                RichExpress.Text = "<a href=\"" + URL + "\"><object height=\"" + Height + "\" width=\"" + Width + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 xcodebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\">" +
                                   "<param name=\"Movie\" value=\""+Src+"\"/> <param name=\"Quality\" value=\"high\"  /><param name=\"wmode\" value=\"transparent\"  />"+
                                   "<embed src=\"" + Src + "\" width=\"" +Width  + "\" height=\"" + Height + "\"  quality=\"high\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></embed></object><a>";
            }
            else
            {
                RichExpress.Text = "<a href=\"" + URL + "\"><img height=\"" + Height + "\" width=\"" + Width + "\"  src=\"" + Src + "\"/></a>";
            }
        }
    }
}